<!--#../common/Shell.html-->
<!--content-->
<div id="BackLink">
    <a href="CatalogActionBean.viewMain">Return to Main Menu</a>
</div>

<div id="Catalog">

    <div id="Cart">

        <h2>Shopping Cart</h2>
        <form action="CartActionBean.updateCartQuantities" method="post">
            <table>
                <tr>
                    <th><b>Item ID</b></th>
                    <th><b>Product ID</b></th>
                    <th><b>Description</b></th>
                    <th><b>In Stock?</b></th>
                    <th><b>Quantity</b></th>
                    <th><b>List Price</b></th>
                    <th><b>Total Cost</b></th>
                    <th>&nbsp;</th>
                </tr>

                <tr w:="cart.numberOfItems == 0">
                    <td colspan="8"><b>Your cart is empty.</b></td>
                </tr>

                <tr w:cartItem="cart.cartItems">
                    <td>
                        <a href="CatalogActionBean.viewItem?itemId=${#cartItem.item.itemId}">${#cartItem.item.itemId}</a>
                    </td>
                    <td>${#cartItem.item.product.productId}</td>
                    <td>${#cartItem.item.attribute1} ${#cartItem.item.attribute2}
                        ${#cartItem.item.attribute3} ${#cartItem.item.attribute4}
                        ${#cartItem.item.attribute5} ${#cartItem.item.product.name}</td>
                    <td>${#cartItem.inStock}</td>
                    <td>
                        <input name="${#cartItem.item.itemId}" value="${#cartItem.quantity}" size="3"/>
                    </td>
                    <td>
                        ${fmt(#cartItem.item.listPrice, "$#,##0.00")}
                    </td>
                    <td>
                        ${fmt(#cartItem.total, "$#,##0.00")}
                    </td>
                    <td>
                        <a href="CartActionBean.removeItemFromCart?cartItem=${#cartItem.item.itemId}" class="Button">Remove</a>
                    </td>
                </tr>
                <tr>
                    <td colspan="7">
                        Sub Total: ${fmt(cart.subTotal, "$#,##0.00")}
                        <input type="submit" value="Update Cart"/>
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>

        </form>
        <a w:="cart.numberOfItems > 0" href="OrderActionBean.newOrderForm" class="Button">Proceed to Checkout</a>
    </div>

    <div id="MyList">
        <nt w:a="#{sessionScope.accountBean}" w:="#a!=null && !#a.authenticated && #a.account.listOption">
            <!--#IncludeMyList.html-->
            <!--#IncludeMyList.html end-->
        </nt>
    </div>

    <div id="Separator">&nbsp;</div>
</div>
<!--content end-->
<!--#../common/Shell.html end-->